/**
 * 
 */
package com.java.test.user.dto;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalDateTime;
import java.time.ZoneOffset;

import org.springframework.jdbc.core.RowMapper;

/**
 * @author 交易流水
 *
 */
public class RunWaterInfo implements RowMapper<RunWaterInfo> {
	
	// 主键
	private int  id;
	
	// 账号
	private String gameAccount;
	
	// 投注时间
	private LocalDateTime bettingTime;
	
	// 投注游戏类型
	private int gameType;
	
	// 游戏名称
	private String gameName;
	
	// 投注金额
	private double betAmount;
	
	// 投注结果
	private double betResult;
	

	private String orderId;
	
	

	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getGameAccount() {
		return gameAccount;
	}

	public void setGameAccount(String gameAccount) {
		this.gameAccount = gameAccount;
	}

	public LocalDateTime getBettingTime() {
		return bettingTime;
	}

	public void setBettingTime(LocalDateTime bettingTime) {
		this.bettingTime = bettingTime;
	}

	public int getGameType() {
		return gameType;
	}

	public void setGameType(int gameType) {
		this.gameType = gameType;
	}

	public String getGameName() {
		return gameName;
	}

	public void setGameName(String gameName) {
		this.gameName = gameName;
	}

	public double getBetAmount() {
		return betAmount;
	}

	public void setBetAmount(double betAmount) {
		this.betAmount = betAmount;
	}

	public double getBetResult() {
		return betResult;
	}

	public void setBetResult(double betResult) {
		this.betResult = betResult;
	}

	private String startTime;

	private String endTime;
	
	
	
	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	@Override
	public RunWaterInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
		RunWaterInfo info = new  RunWaterInfo();
		info.setId(rs.getInt("id"));
		info.setBetAmount(rs.getDouble("bet_amount"));
		info.setBetResult(rs.getDouble("bet_result"));
		info.setBettingTime(rs.getTimestamp("betting_time").toInstant().atZone(ZoneOffset.ofHours(8)).toLocalDateTime());
		info.setGameAccount(rs.getString("game_account"));
		info.setGameName(rs.getString("game_name"));
		info.setGameType(rs.getInt("game_type"));
		return info;
	}
		
	
}
